import request from '@/utils/request'

export function getSapList(page = 1, limit = 10) {
  return request({
    url: `sap/all/${limit}/${page}`,
    method: 'get',
  })
}

export function getFindSapList(page = 1, limit = 10, str) {
  return request({
    url: `sap/find/${limit}/${page}`,
    method: 'get',
    params: {
      'findstr': str
    }
  })
}

export function addSap(data) {
  return request({
    url: 'sap/add',
    method: 'post',
    data
  })
}

export function deleteSap(id) {
  return request({
    url: `sap/delete/${id}`,
    method: 'delete',
  })
}

export function findSapBySellId(page = 1, limit = 10, sellId) {
  return request({
    url: `/table/find/sellid/${limit}/${page}`,
    method: 'get',
    params: {
      'sellid': sellId
    }
  })
}
